<?php
/**
 * @version 	$Id$
 * @author 		$Author$
 * @license 	GNU/GPL see license.php
 *
 */

defined('IN_FLYWHEEL') or die ('Restricted Access');

/**
 * Backend Controller
 * 	base controller of backend application
 * 
 * @package 	backend
 * @subpackage 	controller
 *
 */

class BackendController extends fController {	
	public function executeDefault() {}
	
	/**
	 * Overight parrent execute method
	 *
	 * @return result
	 */
	public function execute() {
		$username = fFactory::getUser()->getAttribute('username');
		$profilesLink = fUri::createUrl('profiles');
		$logoutLink = fUri::createUrl('login', 'logout');		
		fFactory::getTemplate()->assign(array('username'=>$username, 'profilesLink'=>$profilesLink, 'logoutLink'=>$logoutLink));		
		return parent::execute();
	}
	
	/**
	 * Load Modules
	 * 
	 * load modules for application
	 *
	 */
	protected function loadModules() {
		$document = fFactory::getDocument();
		$document->setBlock('left', 'AdminMenu');
		$document->setBlock('bottom', 'BottomBar');		
	}
}